package com.legal.aid.app.domain.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.List;

@JsonInclude(JsonInclude.Include.NON_NULL ) // 忽略空值字段
public class DeepSeekRequestBody {
    //模型名称  deepseek-chat  deepseek-reasoner
   private String model;
   // 对话内容  与deepseek对话的消息列表
   private List<Message> messages;
   // 温度  控制生成文本的随机性
   // 取值范围0-1  0.7表示随机性高  0.1表示随机性低
   private Double temperature;
    //采用的top  0.1表示采用top 10%的概率
   private Double top_p;
   // 最大生成的token数量
   private Integer max_tokens;
   //是否采用流式输出   false 全部返回   true 流式返回
    private Boolean stream;
    // 停止生成的token列表
    private List<String> stop;
    // 控制生成文本的多样性
    // 取值范围0-1  0.7表示多样性高  0.1表示多样性低
    private Double presence_penalty;
    // 控制生成文本的重复度
    // 取值范围0-1  0.7表示重复度高  0.1表示重复度低
    private Double frequency_penalty;
    // 用户标识
    // 用于区分不同的用户  可选
    private String user;

    public static class Message{
             // 角色

        public String getRole() {
            return role;
        }

        public void setRole(String role) {
            this.role = role;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        /**
              * user: 用户
              * assistant: 助手
              * system: 系统
              */
             private String role;
             // 内容  与deepseek的对话内容
             private String content;
             // 名称  与deepseek的对话名称   可选
             private String name;

        @Override
        public String toString() {
            return "Message{" +
                    "role='" + role + '\'' +
                    ", content='" + content + '\'' +
                    ", name='" + name + '\'' +
                    '}';
        }

        public Message(String role, String content, String name) {
            this.role = role;
            this.content = content;
            this.name = name;
        }

        public Message() {
        }
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public List<Message> getMessages() {
        return messages;
    }

    public void setMessages(List<Message> messages) {
        this.messages = messages;
    }

    public Double getTemperature() {
        return temperature;
    }

    public void setTemperature(Double temperature) {
        this.temperature = temperature;
    }

    public Double getTop_p() {
        return top_p;
    }

    public void setTop_p(Double top_p) {
        this.top_p = top_p;
    }

    public Integer getMax_tokens() {
        return max_tokens;
    }

    public void setMax_tokens(Integer max_tokens) {
        this.max_tokens = max_tokens;
    }

    public Boolean getStream() {
        return stream;
    }

    public void setStream(Boolean stream) {
        this.stream = stream;
    }

    public List<String> getStop() {
        return stop;
    }

    public void setStop(List<String> stop) {
        this.stop = stop;
    }

    public Double getPresence_penalty() {
        return presence_penalty;
    }

    public void setPresence_penalty(Double presence_penalty) {
        this.presence_penalty = presence_penalty;
    }

    public Double getFrequency_penalty() {
        return frequency_penalty;
    }

    public void setFrequency_penalty(Double frequency_penalty) {
        this.frequency_penalty = frequency_penalty;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }



    public DeepSeekRequestBody() {
    }

    public DeepSeekRequestBody(String model, List<Message> messages, Double temperature, Double top_p, Integer max_tokens, Boolean stream, List<String> stop, Double presence_penalty, Double frequency_penalty, String user) {
        this.model = model;
        this.messages = messages;
        this.temperature = temperature;
        this.top_p = top_p;
        this.max_tokens = max_tokens;
        this.stream = stream;
        this.stop = stop;
        this.presence_penalty = presence_penalty;
        this.frequency_penalty = frequency_penalty;
        this.user = user;
    }
}
